#ifndef __LED_BLOCK_H__
#define __LED_BLOCK_H__

#include "MountedElectricElementBlock.hpp"

namespace PocketSurvival
{
    // 白色LED灯
    class LedBlock : public MountedElectricElementBlock
    {
    public:
        static constexpr int32_t Index()
        {
            return 152;
        }
		virtual int32_t getIndex() override; 
        virtual const std::string &getBlockName() override;
        virtual int32_t getFace(int32_t value) override;

        virtual void getCreativeValues(std::vector<int32_t> &blockVec) override;
        virtual void getDropValues(int32_t oldValue, int32_t newValue, int32_t toolLevel, std::vector<BlockDropValue> &dropValues) override;
    
        virtual BlockPlacementData getPlacementValue(ComponentMiner *componentMiner, int32_t value, const TerrainRaycastResult &raycastResult) override;
        virtual const std::vector<BoundingBox> &getCustomCollisionBoxes(int32_t value) override;
        

        static inline int32_t GetMountingFace(int32_t data);
        static inline int32_t SetMountingFace(int32_t data, int32_t face);
        static inline int32_t GetColor(int32_t data);
        static inline int32_t SetColor(int32_t data, int32_t color);
		
    };

    inline int32_t LedBlock::GetMountingFace(int32_t data)
    {
        return data & 7;
    }
    inline int32_t LedBlock::SetMountingFace(int32_t data, int32_t face)
    {
        return (data & -8) | (face & 7);
    }
    inline int32_t LedBlock::GetColor(int32_t data)
    {
      return (data >> 3) & 7;
    }
    inline int32_t LedBlock::SetColor(int32_t data, int32_t color)
    {
        return (data & -57) | ((color & 7) << 3);
    }
} // namespace PocketSurvival


#endif
